import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab01VO, Ab01Form, Ab01Query } from '@/api/yuanshidian/ab01/types';

/**
 * 查询原单位信息列表
 * @param query
 * @returns {*}
 */

export const listAb01 = (query?: Ab01Query): AxiosPromise<Ab01VO[]> => {
  return request({
    url: '/yuanshidian/ab01/list',
    method: 'get',
    params: query
  });
};
/**
 * 查询原单位全部信息列表
 * @param query
 * @returns {*}
 */

export const dwnamelist = (query?: Ab01Query): AxiosPromise<Ab01VO[]> => {
  return request({
    url: '/yuanshidian/ab01/dwnamelist',
    method: 'get',
    params: query
  });
};
/**
 * 查询原单位信息详细
 * @param ID
 */
export const getAb01 = (ID: string | number): AxiosPromise<Ab01VO> => {
  return request({
    url: '/yuanshidian/ab01/' + ID,
    method: 'get'
  });
};

/**
 * 新增原单位信息
 * @param data
 */
export const addAb01 = (data: Ab01Form) => {
  return request({
    url: '/yuanshidian/ab01',
    method: 'post',
    data: data
  });
};

/**
 * 修改原单位信息
 * @param data
 */
export const updateAb01 = (data: Ab01Form) => {
  return request({
    url: '/yuanshidian/ab01',
    method: 'put',
    data: data
  });
};

/**
 * 删除原单位信息
 * @param ID
 */
export const delAb01 = (ID: string | number): AxiosPromise<Ab01VO> => {
  return request({
    url: '/yuanshidian/ab01/' + ID,
    method: 'delete'
  });
};
/**
 * 查询新单位信息详细
 * @param ID
 */
export const getAb01New = (ID: string | number): AxiosPromise<Ab01VO> => {
  return request({
    url: '/yuanshidian/ab01new/' + ID,
    method: 'get'
  });
};
/**
 * 单位驳回
 * @param ID
 */
export const turndownab01 = (ID: string | number): AxiosPromise<Ab01VO> => {
  return request({
    url: '/yuanshidian/ab01/turndown/' + ID,
    method: 'get'
  });
};
/**
 * 提交审核
 * @param ID
 */
export const updateStatus = (ID: string | number): AxiosPromise<Ab01VO> => {
  return request({
    url: '/yuanshidian/ab01/submit/' + ID,
    method: 'get'
  });
};
/**
 * 查询原单位信息列表
 * @param query
 * @returns {*}
 */

export const listAb01New = (query?: Ab01Query): AxiosPromise<Ab01VO[]> => {
  return request({
    url: '/yuanshidian/ab01new/list',
    method: 'get',
    params: query
  });
};
/**
 * 审核
 * @param query
 * @returns {*}
 */

export const examine = (query?: Ab01Query): AxiosPromise<Ab01VO[]> => {
  return request({
    url: '/yuanshidian/ab01/examine',
    method: 'post',
    data: query
  });
};
/**
 * 修改退费标识
 * @param query
 * @returns {*}
 */

export const updateRefStatus = (query?: Ab01Query): AxiosPromise<Ab01VO[]> => {
  return request({
    url: '/yuanshidian/ab01/updateRefStatus',
    method: 'get',
    params: query
  });
};
